package com.zhangyusheng.easyecharts.component;


import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TODO: 标题
 *
 * @author Michael zhang
 * @email zhangys_0217@sina.com
 * @since 2025年11月03日
 */
@Data
@Accessors(chain = true)
public class Title implements Serializable {
    private final static long serialVersionUID = 2L;

    private boolean show = true;

    private String text;
    private String subtext;

    public static class Builder{

        private boolean show = true;
        private String text;
        private String subtext;

        public Builder text(String text){
            this.text = text;
            return this;
        }
        public Builder show(boolean show){
            this.show = show;
            return this;
        }
        public Builder subtext(String subtext){
            this.subtext = subtext;
            return this;
        }
        public Title build(){
            return new Title(this);
        }
    }

    private Title(Builder builder){
        this.show = builder.show;
        this.text = builder.text;
        this.subtext = builder.subtext;
    }
}
